﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentQltyPartsNeedStockList.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.AgentQltyPartsNeedStockList" %>
<%--旧件需返回,①	索赔结算,③供应商发货--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/MachineSys/EasyUI/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="/MachineSys/EasyUI/themes/icon.css" />
	<script type="text/javascript" src="/MachineSys/js/jquery-1.7.2.min.js"></script>   
	<script type="text/javascript" src="/MachineSys/EasyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/MachineSys/EasyUI/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/MachineSys/EasyUI/easyui-formatter_20140718.js?v2"></script>
     <link href="/MachineSys/themes/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="/MachineSys/js/DWZ/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="/MachineSys/js/DWZ/jquery.inputValue.js" type="text/javascript"></script>
    <script type="text/javascript">
        ///自适应宽高
        $(window).resize(function(){		    
            $("#tab_list").datagrid({
                width: '100%',
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
            }); 
        });

        $(document).ready(function () {
            //权限处理
            var $powers={
                "r查看":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.查看) %>,
                "r新增":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.新增) %>,
                "r修改":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.修改) %>,
                "r删除":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.删除) %>,
                "r导出":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.导出) %> 
                };
            var $tab_toolbar=$("#tab_toolbar");
            $tab_toolbar.find("a").each(function(){
                var $per=$(this).attr("Permission");
                var pt= $powers[$per]==undefined || null?true:$powers[$per];
                $(this).linkbutton(pt?'enable': 'disable');
            })

            //自动完成
            $(".autocomplete").each(function () {
                var $this = $(this);
                var url = unescape($this.attr("autocompletehref"));
                $this.autocomplete(url);
            });
            //条件查询
            $("#search-buttons").find("#btn_search").click(function () {
                var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
                query.action = "query";
                $('#tab_list').datagrid("options").queryParams = query;
                $('#tab_list').datagrid('load');
                $("#tab_search").dialog("close");
                return false;
            });

            var lastIndex;
            $('#tab_list').datagrid({               
                url: location.href,
                queryParams: { "action": "query" },
                width: '100%', //宽度    
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
                toolbar: "#tab_toolbar",
                rowStyler:function(index,row)
                {
                    if(row.Status=="已发")
                        return  "color:red;";  
                }               
            });   
        })

        
        //修改，通过工具栏
        function onEditClick() {

            var row = $('#tab_list').datagrid('getSelected')
            if (row == null) {
                $.messager.alert('提示', '请先选择要修改的记录');
                return false;
            }           

            var QltyId = row.QltyId;
            var ID = row.ID;
            var rel = "AgentQltyPartsNeedStockUpdate";
            var url = "SvrMgr/AgentQltyPartsNeedStockUpdate.aspx?QltyId=" + QltyId+"&ID="+ID;
            var title = "修改";
            var options = { width: 850, height: 455, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.$.pdialog.open(url, rel, title, options);
            // top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
        }
        function onView2Click(type)
        {
            $("#tab_search").find("#AgentQltyPartsNeedStockList_ShowType").val(type)
            var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
            query.action = "query";
          //  query.ShowType = type;
            $('#tab_list').datagrid("options").queryParams = query;
            $('#tab_list').datagrid('load');
            $("#tab_search").dialog("close");
            return false;
        }

        

        function onExportList() {
            var query = $("#tab_search").serializeJSON();  
            query.action = "query";
            
            var href = "<%= ExportExcelWebUrl%>/AgentSys/AgentQltyPartsNeedStockList.aspx?"+jQuery.param(query) ;
           // alert(href)
            top.window.open(href, "");
        }


        function onViewGuiFanClick()
        {

            var rel = "ViewGuiFan";
            var url = "SvrMgr/AgentQltyPartsGetInGuiFan.aspx";
            var title = "旧件返回规范";
            var options = { width: 550, height: 300, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
           // top.$.pdialog.open(url, rel, title, options);
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
           // $('#tab_list').datagrid('unselectAll')//取消选中,不然会直接选中上次的数据
            return false;
        }
        function onViewWuPaiBiLiClick()
        {

            var rel = "ViewWuPaiBiLi";
            var url = "SvrMgr/AgentQltyPartsGetInWuPaiBiLi.aspx";
            var title = "旧件返回误判率";
            var options = { width: 550, height: 300, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            // top.$.pdialog.open(url, rel, title, options);
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            // $('#tab_list').datagrid('unselectAll')//取消选中,不然会直接选中上次的数据
            return false;
        }

        function onViewSPZGLClick()
        {
            var rel = "AgentQltyPartsGetSPZGL";
            var url = "SvrMgr/AgentQltyPartsGetSPZGL.aspx";
            var title = "索赔件自给率";
            var options = { width: 550, height: 300, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            // top.$.pdialog.open(url, rel, title, options);
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            // $('#tab_list').datagrid('unselectAll')//取消选中,不然会直接选中上次的数据
            return false;
        }
    </script>
     
</head>
<body style="margin:2px;" >
     <div id="tab_search" title="查询条件" style=" height:250px; width:500px;" class="easyui-dialog" modal="true" closed="true" buttons="#search-buttons">
        <table class="table_search" width="100%" style=" line-height:21px;">
            <tr>
                <td width="80px">经销商:</td>
                <td width="120px">               
                    <input  name="AgentName"  />
                </td>
                <td width="80px">品情号:</td>
                <td width="80px"> <input  name="ClaimsNumber"  /></td>
            </tr>
            <tr>
                <td>机号:</td>
                 <td >               
                    <input  name="SerialNumber"  class="" />
                </td>
                 <td>配件号:</td>
                 <td >               
                    <input  name="ItemCode"  class="" />
                </td>
            </tr>
            <tr>
                <td>发行日期:</td>
                 <td >               
                    <input  name="IssueDateForm"  class="easyui-datebox" />
                </td>
                 <td>到</td>
                 <td >               
                    <input  name="IssueDateTo"  class="easyui-datebox" />
                </td>
            </tr>
            <tr>
                <td>旧件入库日期:</td>
                 <td >               
                    <input  name="InDateForm"  class="easyui-datebox" />
                </td>
                 <td>到</td>
                 <td >               
                    <input  name="InDateTo"  class="easyui-datebox" />
                </td>
            </tr>
            <tr>
                <td>显示记录:</td>
                 <td >               
                  <select name="ShowType" id="AgentQltyPartsNeedStockList_ShowType" >
                         <option value="0">所有...</option>
                        <option value="1">未全返回</option>
                        <option value="2">已全返回</option>      
                      <option value="3">旧件需返还警报清单</option>                        
				    </select>
                </td>
                 <td></td>
                 <td >               
                    
                </td>
            </tr>
        </table>
        <div id="search-buttons" style=" ">
            <a id="btn_search" href="javascript:;" class="easyui-linkbutton" iconcls="icon-search" plain="true">提交</a> 
            <a href="javascript:;" class="easyui-linkbutton" onclick="$('#tab_search').dialog('close');return false;" iconcls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

    <div id="tab_toolbar" style="padding:2px;">
        <%--<span style=" font-weight:bold; color:red;">只列出索赔结算和供应商发货</span>--%>
       <a href="#" title="高级查找" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="$('#tab_search').dialog('open');" Permission="">查找</a>
       <a href="#" title="未全返回" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="return　onView2Click(1);" Permission="r查看">未全返回</a>
       <a href="#" title="旧件需返回清单" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="return　onView2Click(3);" Permission="r查看">旧件需返回警报</a>
        <a href="#" title="修改" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="return　onEditClick();" Permission="r修改">修改</a>
     
       <a href="#"  class="easyui-linkbutton" iconcls="icon-btnDown" plain="true" onclick="return onExportList();" Permission="r导出" >导出</a>
         <a href="#" title="旧件返回规范" class="easyui-linkbutton" iconcls="icon-ok" plain="true" onclick="return onViewGuiFanClick()" Permission="r查看">旧件返回规范</a>
         <a href="#" title="旧件返回误判率" class="easyui-linkbutton" iconcls="icon-ok" plain="true" onclick="return onViewWuPaiBiLiClick()" Permission="r查看">旧件返回误判率</a>
        <a href="#" title="索赔件自给率" class="easyui-linkbutton" iconcls="icon-ok" plain="true" onclick="return onViewSPZGLClick()" Permission="r查看">索赔件自给率</a>

    </div>   

   <table id="tab_list" sortName="ID" sortOrder="DESC" iconCls="" singleSelect="true" idField="ID"  nowrap="false" striped="true" collapsible="false" remoteSort="true"  toolbar="#tab_toolbar"  pagination="true" pageNumber="1" pageSize="<%=numPerPage %>"  pageList="<%=SetnumPerPage() %>" rownumbers="true" showFooter="false" url="">
		<thead>
			<tr>
                <th field="ClaimsNumber" width="100"  sortable="true">品情号</th>
				<th field="IssueDate" width="100" formatter="formatterdate" sortable="true">发行日期</th>
                <th field="SerialNumber" width="80" sortable="true">机号</th>
				<th field="AgentName" width="100" sortable="true">经销商</th>
				
                <th field="ItemCode" width="100"  sortable="true">配件号</th>
                <th field="Dscription" width="100"  sortable="true">配件名</th>
                <th field="Quantity" width="100"  sortable="true">数量</th>
				<th field="PartsDemand" width="80" sortable="true">部件需求</th>
                <th field="SupperSendDate" width="100" sortable="true" formatter="formatterdate">供应商发货时间</th>
                <th field="RealSendDate" width="100" sortable="true" formatter="formatterdate">配件邮寄出库日期</th>
                <th field="InWillDate" width="100" sortable="true" formatter="formatterdate">旧件预计返回日期</th>
                <th field="InDate" width="100" sortable="true" formatter="formatterdate">旧件入库日期</th>
                <th field="InQuantity" width="80" sortable="true">旧件返回数量</th>
               
			</tr>
		</thead>
	</table>
</body>
</html>
